<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link rel="stylesheet" href="../css/elementUi.css">
    <link rel="stylesheet" href="../css/global.css">
    <style>
        .mask {
            height: 164px;
            width: 164px;
            background: rgba(255, 255, 255, 0.9);
            z-index: 48;
            position: absolute;
            margin-top: -167px;
            padding: -50%;
            text-align: center;
            color: rgb(41, 41, 41);
        }

        .login_type {
            width: 36px;
            float: right;
        }

    </style>
</head>
<body>
<div id="container">
    <div style="margin-top: 20px;color: #606266">服务器地址:</div>
    <div style="margin-top: 5px">
        <el-input placeholder="请输入内容" v-model="address">
            <template slot="prepend">
                <el-select style="width: 93px;float: left" size="medium" v-model="protocol" placeholder="请选择">
                    <el-option key="http://" label="http://" value="http://"></el-option>
                    <el-option key="https://" label="https://" value="https://"></el-option>
                </el-select>
            </template>
        </el-input>
    </div>


    <el-button @click="save" type="primary" style="margin-top:20px;width: 70%;margin-left: 15%" plain>保存设置</el-button>
</div>


</body>
<script src="../js/jquery.min.js"></script>
<script src="../js/util.js" type="module"></script>
<script src="../js/vue.js"></script>
<script src="../js/app.js"></script>
<script src="../js/elementUi.js"></script>

<script type="module">
    import {
        getStorage,
        setStorage
    } from "../js/util.js";

    let vm = new Vue({
        el: "#container",
        data: {
            protocol: "",
            address: ""
        },
        mounted() {
            this.protocol = getStorage("protocol") == null ? default_protocol : getStorage("protocol");
            this.address = getStorage("address") == null ? default_domain : getStorage("address");
        },
        methods: {
            save() {
                setStorage("protocol", this.protocol);
                setStorage("address", this.address);
                window.location.href = "login.html";
            }
        }


    })


</script>
</html>
